package basicprocess.authentication.tablename;

import java.sql.ResultSet;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

public class Transaction implements Authentication
{
	basicprocess.authentication.Condition conditionobject;
	public void getResult() 
	{
		try 
		{	
			try {
				String id=conditionobject.authentication.pool.getHashtabel().get("id").toString();
				String query = "select * from transaction where id ='"+id+"'";
				Vector<Object> field = conditionobject.database.getSelect(query, 'x'); 
				ResultSet rs= conditionobject.database.getSelect(query);
				while(rs.next())
				{
					for(int i=0;i<field.size();i++)
					{
						conditionobject.basichashtable.put(field.get(i), rs.getString(field.get(i).toString()));
					}
				}
			} catch (Exception e) 
			{
				e.printStackTrace();
				Hashtable<Object, Object>table = new Hashtable<Object, Object>();
				table.putAll(conditionobject.authentication.pool.getHashtabel());
				Enumeration<Object> enumeration = table.keys();
				while(enumeration.hasMoreElements())
				{
					String key = enumeration.nextElement().toString();
					conditionobject.basichashtable.put(key, table.get(key).toString());
				}
				
			}
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
	}

	public void setObject(Object object) 
	{	
		conditionobject = (basicprocess.authentication.Condition) object;
	}

}
